home *** CD-ROM | disk | FTP | other *** search
/ Chip: 25 Years Anniversary / CHIP_25Jahre_Jubilaeum.iso / G DATA AddOns2 / WebShop / _SETUP.1 / sb2permbasket.js < prev    next >
Text File  |  2002-02-13  |  5KB  |  116 lines

  1. <!-- sb2permbasket Basket functions       -->
  2. <!-- (c) Copyright 2001 GS Software       -->
  3. <!--                                      -->
  4. <SCRIPT LANGUAGE="JavaScript">
  5.  
  6. function miniBasket()
  7. {
  8.     var tablerowcolor = '#F0F0F0';
  9.     totprice = 0;
  10.  
  11.       var datum = new Date();
  12.  
  13.       if (parent.theBasket.length>1) {
  14.           for (var i = 1; i < parent.theBasket.length; i++)
  15.           {
  16.                 with(parent.theBasket[i])
  17.                 {
  18.                         theitem=Item;
  19.                         thequantity = Quantity; //fulllist.substring(itemstart, itemend);
  20.                         itemtotal = 0;
  21.                         if ((parseFloat(Price2)>0) && (parseInt(Quantity) >= parseInt(Quantity2)))
  22.                                 theprice=Price2
  23.                         else
  24.                                 if ((parseFloat(Price1)>0) && (parseInt(Quantity) >= parseInt(Quantity1)))
  25.                                         theprice=Price1
  26.                                 else
  27.                                         theprice = Price;
  28.                         itemtotal = (eval(theprice*thequantity));
  29.                         temptotal = itemtotal * 100;
  30.                         totprice = totprice + itemtotal;
  31.                         if(Attribut1=='') A1=''; else A1=', '+Attribut1;
  32.                         if(Attribut2=='') A2=''; else A2=', '+Attribut2;
  33.                         if(Attribut3=='') A3=''; else A3=', '+Attribut3;
  34.  
  35.                         itemlist=i;
  36.                         hilf="";
  37.                         if (Textin != "") hilf="<br> "+Textin;
  38.  
  39.  
  40.                 }
  41.           }
  42.  
  43.         document.writeln('<table class="basketsmall" width="100%" border="0" cellspacing="0" cellpadding="0">');
  44.  
  45.         document.writeln('<tr BGCOLOR="#F8F8F8">');
  46.  
  47.           document.write('<td width="50" nowrap class="basketsmall" align="left" valign="top"> <a href="main.htm" class="none" target="Hauptframe" onFocus="if(this.blur)this.blur()"><img src="kl_home.gif" border="0" align="absmiddle" alt="Home"></a>');
  48.           document.write(' <a href="basket.htm" class="none" target="Hauptframe" onFocus="if(this.blur)this.blur()"><img src="kl_fragezeichen.gif" border="0" align="absmiddle" alt="Warenkorb anzeigen"></a>');
  49.             // Create unique transaction number
  50.         mydate = String(datum.getDate());
  51.             if (mydate.length<2) {
  52.               mydate = "0" +mydate;
  53.             }
  54.         mymonth = String(datum.getMonth());
  55.             if (mymonth.length<2) {
  56.               mymonth = "0" +mymonth;
  57.             }
  58.         myyear = String(datum.getYear());
  59.             if (myyear.length<4) {
  60.               myyear = String(1900+datum.getYear());
  61.             }
  62.         myhours = String(datum.getHours()); if (myhours.length<2) { myhours = "0" +myhours; } parent.pid = mydate+mymonth+myyear+myhours+'{shopid}'+String(datum.getMinutes())+String(datum.getSeconds())+String(Math.round(Math.random()*9999));
  63.  
  64.             document.writeln('</td>');
  65.             document.writeln('<td width="200" nowrap class="basketsmall" align="left" valign="top" nowrap>');
  66.             document.writeln('<a href="basket.htm" target="Hauptframe">'+(parent.theBasket.length-1)+ ' '+parent.Loc_InBasket+'</a></td>');
  67.           document.writeln('</td>');
  68.  
  69.  
  70.  
  71.           document.write('<td class="basketsmall" align="right" valign="top" nowrap>');
  72.             document.write('<b>{Currency} ');
  73.             document.write(parent.alterError(totprice)+'</b>');
  74.  
  75.  
  76.             {IfUseCurrency1}
  77.             document.write(' ({Currency1} '+parent.alterError(totprice*{CURRENCYCONVERTER1})+')');
  78.             {ElseIfUseCurrency1}
  79.             {EndIfUseCurrency1}
  80.  
  81.           document.writeln('</td>');
  82.  
  83.  
  84.         document.writeln('</tr>');
  85.  
  86.         document.writeln('</table>');
  87.  
  88.       }
  89.       else {
  90.  
  91.         document.writeln('<table class="basketsmallempty" width="100%" border="0" cellspacing="0" cellpadding="0">');
  92.           document.writeln('<tr nowrap>'); // BGCOLOR="#C0C0C0"
  93.  
  94.               document.write('<td width="50" nowrap class="basketsmallempty" align="left" valign="top"> <a href="main.htm" class="none" target="Hauptframe" onFocus="if(this.blur)this.blur()"><img src="kl_home.gif" border="0" align="absmiddle" alt="Home"></a>');
  95.                  document.write(' <a href="basket.htm" class="none" target="Hauptframe" onFocus="if(this.blur)this.blur()"><img src="kl_fragezeichen.gif" border="0" align="absmiddle" alt="Warenkorb anzeigen"></a>');
  96.  
  97.                 document.writeln('</td>');
  98.  
  99.             document.writeln('<td width="200" nowrap class="basketsmallempty" align="left" valign="top">'+parent.Loc_BasketEmpty);
  100.                 document.writeln('</td>');
  101.  
  102.             document.writeln('<td nowrap class="basketsmallempty" align="right" valign="top"> </td>');
  103.           document.writeln('</tr>');
  104.         document.writeln('</table>');
  105.  
  106.  
  107.     }
  108.  
  109.  
  110.  
  111.  
  112.  
  113. }
  114.  
  115. </SCRIPT>
  116.